using UnityEngine;

public class CameraController : MonoBehaviour
{
    public Vector3 targetPos;
    public float speed = 5;
    void Start()
    {

    }
    // Update is called once per frame
    void Update()
    {
        if (Global.player)
        {
            targetPos = Global.player.transform.position;
            targetPos.z = -10;
            transform.position = Vector3.Lerp(transform.position, targetPos, Time.deltaTime * speed);
        }
    }
}
